<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|	example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|	http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two reserved routes:
|
|	$route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
|	$route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/

$route['default_controller'] = "home";

// Danh sach tin theo dia chi, chuyen muc, nhu cau ,loai va quan huyen
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)-t(:num)-d(:num)/(:num)'] = "post/index/$1/$2/$3/$4/$5/$6";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)-t(:num)-d(:num)'] = "post/index/$1/$2/$3/$4/$5";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)-t(:num)/(:num)'] = "post/index/$1/$2/$3/$4/0/$5";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)-d(:num)'] = "post/index/$1/$2/$3/0/$4";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-t(:num)-d(:num)'] = "post/index/$1/$2/0/$3/$4";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)-t(:num)'] = "post/index/$1/$2/$3/$4/0";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)/(:num)'] = "post/index/$1/$2/$3/0/0/$4";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-t(:num)/(:num)'] = "post/index/$1/$2/0/$3/0/$4";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)/(:num)'] = "post/index/$1/$2/0/0/0/$3";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-d(:num)'] = "post/index/$1/$2/0/0/$3";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-t(:num)'] = "post/index/$1/$2/0/$3";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)-n(:num)'] = "post/index/$1/$2/$3";
$route['([0-9a-zA-Z\-]+)/:any-c(:num)'] = "post/index/$1/$2";

#$route['search/(:num)']='search/index/$1';
$route['search']='search/index';
//quan tri thanh viên
$route['usercp' . '(/.*)?'] = 'member$1';
$route['usercp'] = "member/dashboard";
$route['usercp/doi-mat-khau']   = "member/user/changepassword";
$route['usercp/ca-nhan']        = "member/user/index";
$route['usercp/post']        = "member/user/post";
$route['usercp/post/trang-(:num)']        = "member/user/post/$1";
//thanh vien
$route['register_active/([0-9a-zA-Z\-_]+)']="user/register_active/$1";
$route['reset_password/([0-9a-zA-Z\-_]+)']="user/reset_password/$1";
$route['dang-ky']="user/register";
$route['dang-ky/thanh-cong']="user/success";
$route['quen-mat-khau']="user/forget_password";
$route['do_forget_password']="user/do_forget_password";
$route['dang-xuat']="user/logout";
$route['dang-nhap']="user";

//ma bao mat
$route['ma-bao-mat']="captcha/index";
$route['ma-bao-mat/kiem-tra']="captcha/validate";

//ajax form
$route['kiem-tra/tai-khoan']="ajax/is_unique_username";
$route['kiem-tra/email']="ajax/ajax_is_unique_email";
$route['dang-tin-rao-vat'] = "post/edit/0";
$route['(:any)-(:num)'] = "post/detail/$2";
$route['([0-9a-zA-Z\-_]+)'] = "home/index/$1";
$route['shop/(:any)']="home/shop/$1";


// Admin
$route['cp'] = "cp/dashboard";
$route['cp' . '(/.*)?'] = 'cp$1';


$route['404_override'] = '';


/* End of file routes.php */
/* Location: ./application/config/routes.php */
